package leetcode.周赛.第245场;

import java.util.Arrays;

/**
 * @author ：zsy
 * @date ：Created 2021/6/13 12:06
 * @description：https://leetcode-cn.com/problems/maximum-number-of-removable-characters/
 */
public class 第1题_重新分配字符使所有字符串都相等 {

    class Solution {
        public boolean makeEqual(String[] words) {
            int[] count = new int[26];
            for(String word : words) {
                for(int i = 0 ; i < word.length(); i++) {
                    count[word.charAt(i) - 'a']++;
                }
            }
            int n = words.length;
            for(int i = 0; i < 26; i++) {
                if(count[i] % n != 0) return false;
            }
            return true;
        }
    }


}
